package com.bt7274.pojo;

import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 用户里程碑达成记录表
 * @TableName user_milestone_record
 */
@Data
public class UserMilestoneRecord {
    /**
     * 
     */
    private String id;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 里程碑类型
     */
    private String milestoneType;

    /**
     * 达成时的值
     */
    private Long achievedValue;

    /**
     * 获得的奖励
     */
    private Integer reward;

    /**
     * 达成时间
     */
    private LocalDateTime achievedTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserMilestoneRecord other = (UserMilestoneRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getMilestoneType() == null ? other.getMilestoneType() == null : this.getMilestoneType().equals(other.getMilestoneType()))
            && (this.getAchievedValue() == null ? other.getAchievedValue() == null : this.getAchievedValue().equals(other.getAchievedValue()))
            && (this.getReward() == null ? other.getReward() == null : this.getReward().equals(other.getReward()))
            && (this.getAchievedTime() == null ? other.getAchievedTime() == null : this.getAchievedTime().equals(other.getAchievedTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getMilestoneType() == null) ? 0 : getMilestoneType().hashCode());
        result = prime * result + ((getAchievedValue() == null) ? 0 : getAchievedValue().hashCode());
        result = prime * result + ((getReward() == null) ? 0 : getReward().hashCode());
        result = prime * result + ((getAchievedTime() == null) ? 0 : getAchievedTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", milestoneType=").append(milestoneType);
        sb.append(", achievedValue=").append(achievedValue);
        sb.append(", reward=").append(reward);
        sb.append(", achievedTime=").append(achievedTime);
        sb.append("]");
        return sb.toString();
    }
}